﻿using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using FunnyArts.PrettyClient.Settings.Views.Windows;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Media;

namespace FunnyArts.PrettyClient.ViewModels
{
    public partial class MainWindowVm : ObservableObject
    {
        [ObservableProperty]
        public string _mainFormTitle=string.Empty;

        [ObservableProperty]
        public ImageSource _mainFormIcon=default;

        public IServiceProvider _serviceProvider;

        public MainWindowVm(IServiceProvider serviceProvider)
        {
            _serviceProvider = serviceProvider;
        }
        [RelayCommand]
        public void OnSystemSetting()
        {
            SettingsWindow _settingsWindow= _serviceProvider.GetRequiredService<SettingsWindow>();
            _settingsWindow.Show();
        }
        [RelayCommand]
        public void OnClose()
        {
            App.Current.Shutdown();
        }
    }
}
